package mediator;

/**
 * @Author liangliangzhao
 * @data 2023/4/19 12:00
 */

public class CoffeeMachine extends Colleague{
    public CoffeeMachine(Mediator mediator, String name) {
        super(mediator, name);
        mediator.Register(name, this);
    }
    @Override
    public void SendMessage(int stateChange) {
        this.GetMediator().GetMessage(stateChange, this.name);
    }
    public void StartCoffee() {
        System.out.println("咖啡开始");
    }
    public void FinishCoffee() {
        System.out.println("等待5分钟后");
        System.out.println("咖啡完成");
        SendMessage(0);
    }
}
